3.5.74 \(\int \frac {\tan ^2(e+f x)}{\sqrt {a-a \sin ^2(e+f x)}} \, dx\) [474]

Optimal. Leaf size=62 \[ -\frac {\tanh ^{-1}(\sin (e+f x)) \cos (e+f x)}{2 f \sqrt {a \cos ^2(e+f x)}}+\frac {\tan (e+f x)}{2 f \sqrt {a \cos ^2(e+f x)}} \]

[Out]

-1/2*arctanh(sin(f*x+e))*cos(f*x+e)/f/(a*cos(f*x+e)^2)^(1/2)+1/2*tan(f*x+e)/f/(a*cos(f*x+e)^2)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.08, antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3255, 3286, 2691, 3855} \begin {gather*} \frac {\tan (e+f x)}{2 f \sqrt {a \cos ^2(e+f x)}}-\frac {\cos (e+f x) \tanh ^{-1}(\sin (e+f x))}{2 f \sqrt {a \cos ^2(e+f x)}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tan[e + f*x]^2/Sqrt[a - a*Sin[e + f*x]^2],x]

[Out]

-1/2*(ArcTanh[Sin[e + f*x]]*Cos[e + f*x])/(f*Sqrt[a*Cos[e + f*x]^2]) + Tan[e + f*x]/(2*f*Sqrt[a*Cos[e + f*x]^2
])

Rule 2691

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(a*Sec[e +
 f*x])^m*((b*Tan[e + f*x])^(n - 1)/(f*(m + n - 1))), x] - Dist[b^2*((n - 1)/(m + n - 1)), Int[(a*Sec[e + f*x])
^m*(b*Tan[e + f*x])^(n - 2), x], x] /; FreeQ[{a, b, e, f, m}, x] && GtQ[n, 1] && NeQ[m + n - 1, 0] && Integers
Q[2*m, 2*n]

Rule 3255

Int[(u_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_), x_Symbol] :> Int[ActivateTrig[u*(a*cos[e + f*x]^2)^p]
, x] /; FreeQ[{a, b, e, f, p}, x] && EqQ[a + b, 0]

Rule 3286

Int[(u_.)*((b_.)*sin[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = FreeFactors[Sin[e + f*x], x]}, Di
st[(b*ff^n)^IntPart[p]*((b*Sin[e + f*x]^n)^FracPart[p]/(Sin[e + f*x]/ff)^(n*FracPart[p])), Int[ActivateTrig[u]
*(Sin[e + f*x]/ff)^(n*p), x], x]] /; FreeQ[{b, e, f, n, p}, x] &&  !IntegerQ[p] && IntegerQ[n] && (EqQ[u, 1] |
| MatchQ[u, ((d_.)*(trig_)[e + f*x])^(m_.) /; FreeQ[{d, m}, x] && MemberQ[{sin, cos, tan, cot, sec, csc}, trig
]])

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \frac {\tan ^2(e+f x)}{\sqrt {a-a \sin ^2(e+f x)}} \, dx &=\int \frac {\tan ^2(e+f x)}{\sqrt {a \cos ^2(e+f x)}} \, dx\\ &=\frac {\cos (e+f x) \int \sec (e+f x) \tan ^2(e+f x) \, dx}{\sqrt {a \cos ^2(e+f x)}}\\ &=\frac {\tan (e+f x)}{2 f \sqrt {a \cos ^2(e+f x)}}-\frac {\cos (e+f x) \int \sec (e+f x) \, dx}{2 \sqrt {a \cos ^2(e+f x)}}\\ &=-\frac {\tanh ^{-1}(\sin (e+f x)) \cos (e+f x)}{2 f \sqrt {a \cos ^2(e+f x)}}+\frac {\tan (e+f x)}{2 f \sqrt {a \cos ^2(e+f x)}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 43, normalized size = 0.69 \begin {gather*} \frac {-\tanh ^{-1}(\sin (e+f x)) \cos (e+f x)+\tan (e+f x)}{2 f \sqrt {a \cos ^2(e+f x)}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Tan[e + f*x]^2/Sqrt[a - a*Sin[e + f*x]^2],x]

[Out]

(-(ArcTanh[Sin[e + f*x]]*Cos[e + f*x]) + Tan[e + f*x])/(2*f*Sqrt[a*Cos[e + f*x]^2])

________________________________________________________________________________________

Maple [A]
time = 9.58, size = 65, normalized size = 1.05

method result size
default \(\frac {\frac {\sin \left (f x +e \right )}{2}+\frac {\left (\ln \left (\sin \left (f x +e \right )-1\right )-\ln \left (1+\sin \left (f x +e \right )\right )\right ) \left (\cos ^{2}\left (f x +e \right )\right )}{4}}{\cos \left (f x +e \right ) \sqrt {a \left (\cos ^{2}\left (f x +e \right )\right )}\, f}\) \(65\)
risch \(-\frac {i \left ({\mathrm e}^{2 i \left (f x +e \right )}-1\right )}{\sqrt {\left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2} a \,{\mathrm e}^{-2 i \left (f x +e \right )}}\, \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) f}-\frac {\ln \left ({\mathrm e}^{i f x}+i {\mathrm e}^{-i e}\right ) \cos \left (f x +e \right )}{f \sqrt {\left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2} a \,{\mathrm e}^{-2 i \left (f x +e \right )}}}+\frac {\ln \left ({\mathrm e}^{i f x}-i {\mathrm e}^{-i e}\right ) \cos \left (f x +e \right )}{f \sqrt {\left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2} a \,{\mathrm e}^{-2 i \left (f x +e \right )}}}\) \(163\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(f*x+e)^2/(a-a*sin(f*x+e)^2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

(1/2*sin(f*x+e)+1/4*(ln(sin(f*x+e)-1)-ln(1+sin(f*x+e)))*cos(f*x+e)^2)/cos(f*x+e)/(a*cos(f*x+e)^2)^(1/2)/f

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 575 vs. \(2 (59) = 118\).
time = 0.62, size = 575, normalized size = 9.27 \begin {gather*} \frac {4 \, {\left (\sin \left (3 \, f x + 3 \, e\right ) - \sin \left (f x + e\right )\right )} \cos \left (4 \, f x + 4 \, e\right ) - {\left (2 \, {\left (2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )} \cos \left (4 \, f x + 4 \, e\right ) + \cos \left (4 \, f x + 4 \, e\right )^{2} + 4 \, \cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (4 \, f x + 4 \, e\right )^{2} + 4 \, \sin \left (4 \, f x + 4 \, e\right ) \sin \left (2 \, f x + 2 \, e\right ) + 4 \, \sin \left (2 \, f x + 2 \, e\right )^{2} + 4 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )} \log \left (\cos \left (f x + e\right )^{2} + \sin \left (f x + e\right )^{2} + 2 \, \sin \left (f x + e\right ) + 1\right ) + {\left (2 \, {\left (2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )} \cos \left (4 \, f x + 4 \, e\right ) + \cos \left (4 \, f x + 4 \, e\right )^{2} + 4 \, \cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (4 \, f x + 4 \, e\right )^{2} + 4 \, \sin \left (4 \, f x + 4 \, e\right ) \sin \left (2 \, f x + 2 \, e\right ) + 4 \, \sin \left (2 \, f x + 2 \, e\right )^{2} + 4 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )} \log \left (\cos \left (f x + e\right )^{2} + \sin \left (f x + e\right )^{2} - 2 \, \sin \left (f x + e\right ) + 1\right ) - 4 \, {\left (\cos \left (3 \, f x + 3 \, e\right ) - \cos \left (f x + e\right )\right )} \sin \left (4 \, f x + 4 \, e\right ) + 4 \, {\left (2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )} \sin \left (3 \, f x + 3 \, e\right ) - 8 \, \cos \left (3 \, f x + 3 \, e\right ) \sin \left (2 \, f x + 2 \, e\right ) + 8 \, \cos \left (f x + e\right ) \sin \left (2 \, f x + 2 \, e\right ) - 8 \, \cos \left (2 \, f x + 2 \, e\right ) \sin \left (f x + e\right ) - 4 \, \sin \left (f x + e\right )}{4 \, {\left (2 \, {\left (2 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )} \cos \left (4 \, f x + 4 \, e\right ) + \cos \left (4 \, f x + 4 \, e\right )^{2} + 4 \, \cos \left (2 \, f x + 2 \, e\right )^{2} + \sin \left (4 \, f x + 4 \, e\right )^{2} + 4 \, \sin \left (4 \, f x + 4 \, e\right ) \sin \left (2 \, f x + 2 \, e\right ) + 4 \, \sin \left (2 \, f x + 2 \, e\right )^{2} + 4 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )} \sqrt {a} f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^2/(a-a*sin(f*x+e)^2)^(1/2),x, algorithm="maxima")

[Out]

1/4*(4*(sin(3*f*x + 3*e) - sin(f*x + e))*cos(4*f*x + 4*e) - (2*(2*cos(2*f*x + 2*e) + 1)*cos(4*f*x + 4*e) + cos
(4*f*x + 4*e)^2 + 4*cos(2*f*x + 2*e)^2 + sin(4*f*x + 4*e)^2 + 4*sin(4*f*x + 4*e)*sin(2*f*x + 2*e) + 4*sin(2*f*
x + 2*e)^2 + 4*cos(2*f*x + 2*e) + 1)*log(cos(f*x + e)^2 + sin(f*x + e)^2 + 2*sin(f*x + e) + 1) + (2*(2*cos(2*f
*x + 2*e) + 1)*cos(4*f*x + 4*e) + cos(4*f*x + 4*e)^2 + 4*cos(2*f*x + 2*e)^2 + sin(4*f*x + 4*e)^2 + 4*sin(4*f*x
 + 4*e)*sin(2*f*x + 2*e) + 4*sin(2*f*x + 2*e)^2 + 4*cos(2*f*x + 2*e) + 1)*log(cos(f*x + e)^2 + sin(f*x + e)^2
- 2*sin(f*x + e) + 1) - 4*(cos(3*f*x + 3*e) - cos(f*x + e))*sin(4*f*x + 4*e) + 4*(2*cos(2*f*x + 2*e) + 1)*sin(
3*f*x + 3*e) - 8*cos(3*f*x + 3*e)*sin(2*f*x + 2*e) + 8*cos(f*x + e)*sin(2*f*x + 2*e) - 8*cos(2*f*x + 2*e)*sin(
f*x + e) - 4*sin(f*x + e))/((2*(2*cos(2*f*x + 2*e) + 1)*cos(4*f*x + 4*e) + cos(4*f*x + 4*e)^2 + 4*cos(2*f*x +
2*e)^2 + sin(4*f*x + 4*e)^2 + 4*sin(4*f*x + 4*e)*sin(2*f*x + 2*e) + 4*sin(2*f*x + 2*e)^2 + 4*cos(2*f*x + 2*e)
+ 1)*sqrt(a)*f)

________________________________________________________________________________________

Fricas [A]
time = 0.40, size = 67, normalized size = 1.08 \begin {gather*} -\frac {\sqrt {a \cos \left (f x + e\right )^{2}} {\left (\cos \left (f x + e\right )^{2} \log \left (-\frac {\sin \left (f x + e\right ) + 1}{\sin \left (f x + e\right ) - 1}\right ) - 2 \, \sin \left (f x + e\right )\right )}}{4 \, a f \cos \left (f x + e\right )^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^2/(a-a*sin(f*x+e)^2)^(1/2),x, algorithm="fricas")

[Out]

-1/4*sqrt(a*cos(f*x + e)^2)*(cos(f*x + e)^2*log(-(sin(f*x + e) + 1)/(sin(f*x + e) - 1)) - 2*sin(f*x + e))/(a*f
*cos(f*x + e)^3)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\tan ^{2}{\left (e + f x \right )}}{\sqrt {- a \left (\sin {\left (e + f x \right )} - 1\right ) \left (\sin {\left (e + f x \right )} + 1\right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)**2/(a-a*sin(f*x+e)**2)**(1/2),x)

[Out]

Integral(tan(e + f*x)**2/sqrt(-a*(sin(e + f*x) - 1)*(sin(e + f*x) + 1)), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 169 vs. \(2 (59) = 118\).
time = 0.73, size = 169, normalized size = 2.73 \begin {gather*} \frac {\frac {\log \left ({\left | \frac {1}{\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )} + \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 2 \right |}\right )}{\mathrm {sgn}\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 1\right )} - \frac {\log \left ({\left | \frac {1}{\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )} + \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 2 \right |}\right )}{\mathrm {sgn}\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 1\right )} - \frac {4 \, {\left (\frac {1}{\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )} + \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{{\left ({\left (\frac {1}{\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )} + \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}^{2} - 4\right )} \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 1\right )}}{4 \, \sqrt {a} f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^2/(a-a*sin(f*x+e)^2)^(1/2),x, algorithm="giac")

[Out]

1/4*(log(abs(1/tan(1/2*f*x + 1/2*e) + tan(1/2*f*x + 1/2*e) + 2))/sgn(tan(1/2*f*x + 1/2*e)^4 - 1) - log(abs(1/t
an(1/2*f*x + 1/2*e) + tan(1/2*f*x + 1/2*e) - 2))/sgn(tan(1/2*f*x + 1/2*e)^4 - 1) - 4*(1/tan(1/2*f*x + 1/2*e) +
 tan(1/2*f*x + 1/2*e))/(((1/tan(1/2*f*x + 1/2*e) + tan(1/2*f*x + 1/2*e))^2 - 4)*sgn(tan(1/2*f*x + 1/2*e)^4 - 1
)))/(sqrt(a)*f)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \int \frac {{\mathrm {tan}\left (e+f\,x\right )}^2}{\sqrt {a-a\,{\sin \left (e+f\,x\right )}^2}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(e + f*x)^2/(a - a*sin(e + f*x)^2)^(1/2),x)

[Out]

int(tan(e + f*x)^2/(a - a*sin(e + f*x)^2)^(1/2), x)

________________________________________________________________________________________